package com.cryptoneedle.center.doris.service.Information;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.cryptoneedle.center.doris.entity.Information.DorisInformationColumn;
import com.cryptoneedle.center.doris.repository.Information.DorisInformationColumnRepository;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>description: Doris-元数据-Column </p>
 *
 * @author CryptoNeedle
 * @date 2025-09-25
 */
@Service
@Transactional
@DS("doris")
@Slf4j
public class DorisInformationColumnService {

    @Resource
    private DorisInformationColumnRepository dorisInformationColumnRepository;

    public List<DorisInformationColumn> list() {
        return dorisInformationColumnRepository.list();
    }

    public List<DorisInformationColumn> listByDatabase(String catalogName, String databaseName) {
        return dorisInformationColumnRepository.listByDatabase(catalogName, databaseName);
    }

    public List<DorisInformationColumn> listByTable(String catalogName, String databaseName, String tableName) {
        return dorisInformationColumnRepository.listByTable(catalogName, databaseName, tableName);
    }
}